package cn.freereflect.result;

public class RsS {

    private String code;

    private Object data;

    private String msg;



    public static RsS success_login_null(){
        return new RsS(ServerEnum.SUCCESS_LOGIN_NULL.getCode(), ServerEnum.SUCCESS_LOGIN_NULL.getMsg());
    }
    public static RsS success_login_lock(){
        return new RsS(ServerEnum.SUCCESS_LOGIN_NULL.getCode(), ServerEnum.SUCCESS_LOGIN_LOCK.getMsg());
    }
    public static RsS power(String message){
        return new RsS(ServerEnum.SUCCESS_MTOKEN_NULL.getCode(),message);
    }

    public static RsS SUCCESS_ORDER_STOCK_NULL(Object data){
        return new RsS(ServerEnum.SUCCESS_ORDER_STOCK_NULL.getCode(),data, ServerEnum.SUCCESS_ORDER_STOCK_NULL.getMsg());
    }
    public static RsS SUCCESS_ORDER_STOCK_NULL(){
        return new RsS(ServerEnum.SUCCESS_ORDER_STOCK_NULL.getCode(), ServerEnum.SUCCESS_ORDER_STOCK_NULL.getMsg());
    }

    public static RsS success(){
        return new RsS(ServerEnum.SUCCESS.getCode(), ServerEnum.SUCCESS.getMsg());
    }
    public static RsS success_with(String msg){
        return new RsS(ServerEnum.SUCCESS.getCode(), msg);
    }
    public static RsS success_with(String msg, Object data){
        return new RsS(ServerEnum.SUCCESS.getCode(),data, msg);
    }

    public static RsS success(Object data){
        return new RsS(ServerEnum.SUCCESS.getCode(),data, ServerEnum.SUCCESS.getMsg());
    }
    public static RsS noLogin(){
        return new RsS(ServerEnum.SUCCESS_NO_LOGIN.getCode(), ServerEnum.SUCCESS_NO_LOGIN.getMsg());
    }
    public static RsS noPromess(){
        return new RsS(ServerEnum.SUCCESS_NO_PROMESS.getCode(), ServerEnum.SUCCESS_NO_PROMESS.getMsg());
    }
    public static RsS success_login(){
        return new RsS(ServerEnum.SUCCESS_LOGIN.getCode(), ServerEnum.SUCCESS_LOGIN.getMsg());
    }
    public static RsS success_login(Object data){
        return new RsS(ServerEnum.SUCCESS_LOGIN.getCode(),data, ServerEnum.SUCCESS_LOGIN.getMsg());
    }

    public RsS() {
    }


    public RsS(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public RsS(String code, Object data, String msg) {
        this.code = code;
        this.data = data;
        this.msg = msg;
    }

    public static RsS error(String toString) {
        return new RsS(ServerEnum.ERROR.getCode(),toString);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
